package com.wl4837.demo2;

public class App
{
    public static void main( String[] args )
    {
        DBConnectionFactory mysqlFactory = new MySQLConnectionFactory();
        DBConnection mysqlConnection = mysqlFactory.createConnection();
        mysqlConnection.connect(); // 输出：Connecting to MySQL database...

        DBConnectionFactory oracleFactory = new OracleConnectionFactory();
        DBConnection oracleConnection = oracleFactory.createConnection();
        oracleConnection.connect(); // 输出：Connecting to Oracle database...
    }
}
